#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    srand(time(0));
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_clicked()
{
    ui->label->setText("嘻嘻，好兄弟快上号！");
}

void Widget::on_pushButton_2_pressed()
{
    QRect rect = ui->pushButton_2->geometry();

    int x = rand() % (this->geometry().width());
    int y = rand() % (this->geometry().height());


    ui->label->setText("到底打不打！？");

    ui->pushButton_2->setGeometry(x ,y ,rect.width(), rect.height());

}
